<%-- 
    Document   : view-tdq-data
    Created on : 19 Mei 11, 13:58:10
    Author     : Bayu
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>TDQ Data</title>
        <jsp:include page="includes/script.html"/>
    </head>
    <body>
        <center>
         <form method="get">

          Tahun :
          <select name="year">
          <c:forEach var="i" begin="${minYear}" end="${maxYear}">
               <c:choose>
                <c:when test="${year == i}">
                    <c:set var="select" value="selected"></c:set>
                </c:when>
                <c:otherwise>
                    <c:set var="select" value=""></c:set>
                </c:otherwise>
               </c:choose>
              <option value="${i}" ${select}>${i}</option>
          </c:forEach>
        </select>
          <input type="submit" value="View Report">
        </form>
        </center>

        <h2 align="center">DATA LIST PEMBUATAN TDQ TAHUN ${year}</h2>


        <center>


        ${msg}
        <br>
        <table cellpading="1" cellspacing="1" bgcolor="#010101" align="center" width="800">

            <tr bgcolor="#c2c3c4">
                            <td width="20%" align="center">Part Name</td>
                            <td width="20%" align="center">Part Number</td>
                            <td width="20%" align="center">Customer</td>
                            <td width="20%" align="center">Month</td>
                            <td width="20%" align="center">Action</td>
                        </tr>
                        <c:forEach items="${data}" var="data">
                            <tr bgcolor="#f2f3f4">
                            <td>${data.partName}</td>
                            <td>${data.partNumber}</td>
                            <td>${data.customer}</td>
                            <td><fmt:formatDate pattern="MMMM" value="${data.date}" /></td>
                            <td>
                                <a href="tdq-update.htm?id=${data.id}">Edit</a>&nbsp;
                                <a href="view-tdq-data.htm?id=${data.id}">Delete</a>&nbsp;
                            </td>

                        </tr>
                        </c:forEach>

                </table>
        </center>
    </body>
</html>
